import axios from "@/api/config"

export async function getManagementList(data) { //用户列表获取
    const url = `/user/admins?page=${data.page}&limit=${data.limit}&account=${data.account}&section=${data.section}&shop=${data.shop}&name=${data.name}&auth=${data.auth}`;
    let res = await axios.get(url);
    return res.data;
}
export async function addManagement(data) { //用户新增
    const url = '/user/admin';
    const res = await axios.post(url,data);
    return res.data;
}
export async function updateManagement(data) { //更新职工信息
    const url = '/user/admin';
    const res = await axios.put(url,data);
    return res.data;
}
export async function getManagementDetail(data) {
    const url = `/user/admins?page=${data.page}&limit=${data.limit}&id=${data.id}`;
    let res = await axios.get(url);
    return res.data;
}
export async function deleteManagement(data) { //删除职工信息
    const url = '/user/admin/'+data;
    const res = await axios.delete(url);
    return res.data;
}
export async function getTree() {//获取树形组织结构
    const url = '/config/organization';
    const res = await axios.get(url);
    return res;
}